package com.winsdom.mapper;

import com.winsdom.domain.vo.TopRoledVO;
import com.winsdom.entity.SysRole;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.winsdom.vo.RoleInformationVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 角色表 Mapper 接口
 * </p>
 *
 * @author 
 * @since 2025-05-12
 */
@Mapper
public interface SysRoleMapper extends BaseMapper<SysRole> {

    /**
     * 获取角色名称
     * @return
     */
    @Select("SELECT role_name from sys_role where `status`=1 and is_deleted=0")
    List<RoleInformationVO> getAllRole();

    int disableRole(Long roleId);

    Long selectRole(Long roleId);

    Long enableRole(Long roleId);
    int selectRoles(String name);

    List<TopRoledVO> getListRole();
}
